package cn.hlife.com.hlfhaemocyte.notify;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/7/26.
 */
public class Transporter implements Watched {

    private List<Watcher> list = new ArrayList<Watcher>();
    @Override
    public void addWatcher(Watcher watcher) {
        list.add(watcher);
    }

    @Override
    public void removeWatcher(Watcher watcher) {
        list.remove(watcher);
    }

    @Override
    public void notifyWatchers(String mac,boolean isState) {
        for (Watcher watcher : list) {
            watcher.update(mac,isState);
        }
    }
}